package com.sumainfor.pc.market.controller.gmio;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.gmio.TcmktPactNextPaIdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 查询续租情况
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-04-30 18:54
 **/
@Controller
@RequestMapping("/key/TcmktPact")
public class TcmktPactNextPaIdController {

    @Autowired
    TcmktPactNextPaIdService tcmktPactNextPaIdService;

    /**
    * <p>
    * 续租率和续租间数
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @PostMapping("/forRenewal")
    public JsonResult forRenewal(@RequestBody Map<String,Object> params){
        JsonResult result = new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"State"})){
            result.putFailed("State不能为空!");
        }
        return tcmktPactNextPaIdService.forRenewal(params);
    }
}
